//
//  CreditTitlesLayer.m
//  FairyGame
//
//  Created by 李 世宸 on 2009/7/30.
//  Copyright 2009 __MyCompanyName__. All rights reserved.
//

// Import the interfaces
#import "CreditTitlesLayer.h"

// HelloWorld implementation
@implementation CreditTitles

// on "init" you need to initialize your instance
-(id) init
{
	// always call "super" init
	// Apple recommends to re-assign "self" with the "super" return value
	if( (self=[super init] )) {
		
		//設定計時 Timers
		//@selector後接fun
		[self schedule: @selector(tick:)];
		[self schedule: @selector(tick2:) interval:2.0];
		
		// create and initialize a Label
		Label* label = [Label labelWithString:@"Hello FairGame" fontName:@"Marker Felt" fontSize:64];

		// ask director the the window size
		CGSize size = [[Director sharedDirector] winSize];
	
		// position the label on the center of the screen
		label.position =  ccp( size.width /2 , size.height/2 );
		
		// add the label as a child to this Layer
		[self addChild: label];
	}
	return self;
}

-(void) tick: (ccTime) dt
{
    // bla bla bla
}

-(void) tick2: (ccTime) dt
{
    //切換至Menu
	MenuScene * ms = [MenuScene node];
	[[Director sharedDirector] replaceScene:ms];
}

// on "dealloc" you need to release all your retained objects
- (void) dealloc
{
	// in case you have something to dealloc, do it in this method
	// in this particular example nothing needs to be released.
	// cocos2d will automatically release all the children (Label)
	
	// don't forget to call "super dealloc"
	[super dealloc];
}
@end
